package com.acsior.hibernate.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;

/**
 * PaymentService entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "payment_services")
@GeneratorKey(tableName = "service_requests")
public class PaymentServiceVO extends PayableServiceVO {

	private static final long serialVersionUID = -4917210561418339622L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "authorized_customer_id")
	private CustomerVO customerByAuthorizedCustomer;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", nullable = false)
	private CustomerVO customerByCustomer;

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", nullable = false, length = 10)
	private Date endDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_payment_method_id", nullable = false)
	private NomPaymentMethodVO nomPaymentMethod;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_payment_type_id", nullable = false)
	private NomPaymentTypeVO nomPaymentType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_person_relationship_type_id")
	private NomPersonRelationshipTypeVO nomPersonRelationshipType;

	@Column(name = "payment_number", nullable = false, length = 50)
	private String paymentNumber;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postman_payment_id")
	private PostmanPaymentVO postmanPayment;

	@Column(name = "remark")
	private String remark;

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", nullable = false, length = 10)
	private Date startDate;

	/** default constructor */
	public PaymentServiceVO() {
		super();
	}

	/** @see PayableServiceVO#getCustomer() */
	@Override
	public CustomerVO getCustomer() {
		return getCustomerByCustomer();
	}

	/** @return the customerByAuthorizedCustomer */
	public CustomerVO getCustomerByAuthorizedCustomer() {
		return this.customerByAuthorizedCustomer;
	}

	/** @return the customerByCustomer */
	public CustomerVO getCustomerByCustomer() {
		return this.customerByCustomer;
	}

	/** @return the endDate */
	@Override
	public Date getEndDate() {
		return this.endDate;
	}

	/** @return the nomPaymentMethod */
	public NomPaymentMethodVO getNomPaymentMethod() {
		return this.nomPaymentMethod;
	}

	/** @return the nomPaymentType */
	public NomPaymentTypeVO getNomPaymentType() {
		return this.nomPaymentType;
	}

	/** @return the nomPersonRelationshipType */
	public NomPersonRelationshipTypeVO getNomPersonRelationshipType() {
		return this.nomPersonRelationshipType;
	}

	/** @see PayableServiceVO#getNumber() */
	@Override
	public String getNumber() {
		return getPaymentNumber();
	}

	/** @return the paymentNumber */
	public String getPaymentNumber() {
		return this.paymentNumber;
	}

	/** @return the postmanPayment */
	@Override
	public PostmanPaymentVO getPostmanPayment() {
		return this.postmanPayment;
	}

	/** @return the remark */
	@Override
	public String getRemark() {
		return this.remark;
	}

	/** @return the startDate */
	@Override
	public Date getStartDate() {
		return this.startDate;
	}

	/** @see PayableServiceVO#setCustomer(CustomerVO) */
	@Override
	public void setCustomer(CustomerVO customer) {
		setCustomerByCustomer(customer);
	}

	/**
	 * @param customerByAuthorizedCustomer
	 *            the customerByAuthorizedCustomer to set
	 */
	public void setCustomerByAuthorizedCustomer(CustomerVO customerByAuthorizedCustomer) {
		this.customerByAuthorizedCustomer = customerByAuthorizedCustomer;
	}

	/**
	 * @param customerByCustomer
	 *            the customerByCustomer to set
	 */
	public void setCustomerByCustomer(CustomerVO customerByCustomer) {
		this.customerByCustomer = customerByCustomer;
	}

	/**
	 * @param endDate
	 *            the endDate to set
	 */
	@Override
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * @param nomPaymentMethod
	 *            the nomPaymentMethod to set
	 */
	public void setNomPaymentMethod(NomPaymentMethodVO nomPaymentMethod) {
		this.nomPaymentMethod = nomPaymentMethod;
	}

	/**
	 * @param nomPaymentType
	 *            the nomPaymentType to set
	 */
	public void setNomPaymentType(NomPaymentTypeVO nomPaymentType) {
		this.nomPaymentType = nomPaymentType;
	}

	/**
	 * @param nomPersonRelationshipType
	 *            the nomPersonRelationshipType to set
	 */
	public void setNomPersonRelationshipType(NomPersonRelationshipTypeVO nomPersonRelationshipType) {
		this.nomPersonRelationshipType = nomPersonRelationshipType;
	}

	/** @see PayableServiceVO#setNumber(String) */
	@Override
	public void setNumber(String number) {
		setPaymentNumber(number);
	}

	/**
	 * @param paymentNumber
	 *            the paymentNumber to set
	 */
	public void setPaymentNumber(String paymentNumber) {
		this.paymentNumber = paymentNumber;
	}

	/** @param postmanPayment */
	@Override
	public void setPostmanPayment(PostmanPaymentVO postmanPayment) {
		this.postmanPayment = postmanPayment;
	}

	/**
	 * @param remark
	 *            the remark to set
	 */
	@Override
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @param startDate
	 *            the startDate to set
	 */
	@Override
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

}